home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / magazi~1 / 207a / learnbas / learnbas.doc next >
Encoding:
Text File  |  1988-12-04  |  1.9 KB  |  52 lines

  1.  
  2.  
  3. POWER BASIC LISTINGS
  4.  
  5. Two file-types exist in the LEARNBAS folder:
  6.  
  7. .BA    -    Power BASIC demo version
  8. .BAS   -    Power BASIC full version
  9.  
  10.  
  11. Boot up your Power BASIC select LOAD from the FILE menu, insert Cover 
  12. Disk 5, click on the icon in the top left of the File-Select box
  13. and then double click on one of the BA/BAS files when they appear. 
  14. That's it. The files will load; you may then run them or alter them. 
  15.  
  16. The following files complement the LEARN BASIC article in the magazine. 
  17.  
  18.  
  19. TELEPHONE.BAS
  20.  
  21. This program demonstrates the use of arrays to store and retrieve
  22. information. You can enter up to ten names and addresses and recall
  23. the phone numbers in any order by searching for the corresponding
  24. name. It also shows use of the INSTR function to search for a given
  25. string of characters anywhere within another string.
  26.  
  27. The arrays are set up with BASIC's DIM statement and then
  28. each cell within the array can be addressed by quoting its co-
  29. ordinates.
  30.  
  31.  
  32. PHONEDAT.BAS
  33.  
  34. This program is an extension of the TELEPHON.BAS program which stores
  35. and retrieves names and telephone numbers typed in from the keyboard.
  36. PHONEDAT.BAS loads the information into the array from DATA statements
  37. at the end of the file. This means that you no longer have to enter
  38. the information each time you run the program, but can let the program
  39. do it automatically. You can, of course, change the names and numbers
  40. within the DATA statement to make them more relevant to you, and
  41. extend the program by enlarging the dimensions of the array and
  42. increasing the number of items in the DATA line. Make sure that the
  43. number of elements in one dimension of the array is at least as large
  44. as the number of names in the DATA statements, and that if the data
  45. item includes spaces, it is enclosed in inverted commas (").
  46.  
  47. A single, two dimensional array is used to hold the
  48. information, as this makes it easier to tie the name to its
  49. corresponding telephone number.
  50.  
  51.  
  52.